import { useEffect, FC, useState, useRef } from 'react';
import { View, Image } from '@tarojs/components'
import './index.less'
import Checking from '@resource/tabImg/checking.svg'

type Prop = {
  checked: boolean,
  onChange: (any) => void
}

const Index: FC<Prop> = ({ checked = false, onChange }) => {

  useEffect(() => {
    // 任何你需要在组件挂载时执行的副作用
  }, []);

  return (
    <View className="my-checkbox" onClick={onChange}>
      {checked && <Image className='checkbox' src={Checking} mode='aspectFill' />}
    </View>
  );
};

export default Index;
